<?php
namespace BoxEdu\Controller\Admin;
//use Think\Controller;

class SubjectController extends CommonController {
	public function _initialize() {
		parent::_initialize();
		$this->subject = BoxModel("EduSubject");
		$this->subject_class_type = dict("subject_class_type");
		$this->subject_class = $this->subject->subject_class();
	}

	/******课程管理****/
	public function index() {
		$where = "is_show=1 and parent_id=0";
		if ($this->kw = I('kw')) {
			$where .= " and (subject like '%$this->kw%'  )";
		}
		$this->subject_class_id = I('subject_class_id', "0", "intval");
		if ($this->subject_class_id) {
			$where .= " and (subject_class = '$this->subject_class_id')";
		}
		//	dump($this->subject_class );
		$data = $this->subject->get($where, 10, "subject_class,order_by");
		$this->data = $data['list'];
		$this->page = $data['pager']->show;
		$this->display();
	}
	function kown_delete() {
		$data = BoxModel("edu_sections")->where("is_show<>1")->select();
		// dump($data);
		$ids = array();
		foreach ($data as $one) {
			$ids[] = $one['sectionid'];
		}

		$ids = implode(",", $ids);
		dump($ids);
		$count = BoxModel("edu_knows")->where("knowssectionid in ($ids) or knowssectionid =0")->delete();
		dump($count);
		exit();
	}
	//设置题库
	public function settikuNav() {
		$tikuNav = dict('tikuNav');
		$this->subjectid = I('subjectid');
		$data = BoxModel("edu_subject")->load($this->subjectid);
		//dump($data['tikuNavArray']);
		foreach ($tikuNav as $k => $one) {
			if ($data['tikuNavArray'][$k]) {
				$tikuNav[$k]['checked'] = 'checked="checked"';
			}

		}

		$this->tikuNavArray = $tikuNav;
		//dump($this->tikuNavArray);
		if (IS_POST) {
			$row = array();
			$tikuNav2 = I('tikuNav');
			//	dump($tikuNav2);
			//	dump($tikuNav);
			foreach ($tikuNav2 as $k => $one) {
				$row[$one] = $tikuNav[$one];
			}

			//	dump($row);exit();
			$r = BoxModel("edu_subject")->where(array('subjectid' => $this->subjectid))->save(array('tikuNav' => json_encode($row)));
			$this->jump("保存成功");
		}
		$this->display();
	}

	/******收货地址管理****/
	public function address() {
		$where = "is_show=1 and parent_id=0";
		$this->subjectData = $this->subject->get($where, "", "subject_class,order_by");
		$this->subject_class_id = I('subject_class_id');
		$this->subjectid = I('subjectid');
		$where = "status in (2,4)";
		if ($this->subjectid) {
			$where .= " and subjectid=$this->subjectid";
		}
		if ($this->status = I('status', "0", "intval")) {
			if ($this->status == 1) {
				$where .= " and logistics<>''";
			} else {
				$where .= " and logistics=''";
			}
		}
		$bool = 1;
		if ($this->kw = I('kw')) {
			$user_id = BoxModel("system_member")->getIn(" (name like '%$this->kw%' or phone like '%$this->kw%' or address like '%$this->kw%')", "user_id");
			if ($user_id) {
				$where .= " and user_id in ($user_id)";
			} else {
				$bool = 0;
			}
		}
		if ($bool) {
			$data = BoxModel("edu_subject_order")->get($where, 10);
			$order_logistics = BoxModel("system_order_logistics");
			foreach ($data['list'] as $k => $one) {
				$data['list'][$k]['logistics'] = $order_logistics->where(array('order_sn' => $one['order_sn']))->find();
			}
			$this->data = $data['list'];
			$this->show_page($data['pager']);
			//$this->page = $data['pager']->show;
		}
		$this->display();
	}

	/****课程分类***/
	public function subject_class() {
		// dump($this->subject_class);
		$this->display();
	}

	/****添加课程分类***/
	public function add_subject_class() {
		$this->memuNav = "subject_class";
		$id = I('id');
		if ($id) {
			$this->data = BoxModel("edu_subject_class")->where(array('id' => $id))->find();
		}
		if (IS_POST) {
			$arr = BoxModel("edu_subject_class")->create();
			$arr['content'] = htmlspecialchars_decode(I('content', '', 'trim'));
			if ($id) {
				BoxModel("edu_subject_class")->where(array('id' => $id))->save($arr);
			} else {
				$arr['add_time'] = date("Y-m-d H:i:s");
				BoxModel("edu_subject_class")->add($arr);
			}
			$this->jump("操作成功", U('Subject/subject_class'));
		}
		$this->display();
	}

	/****删除课程分类***/
	public function del_subject_class() {
		$id = I('id');
		BoxModel("edu_subject_class")->where(array('id' => $id))->save(array('is_show' => 2));
		$this->jump("删除成功");
	}

	/*****班级动态**/
	public function subject_new() {
		$this->classrooms_list = BoxModel("edu_subject")->get("is_show=1", "", "subject_class");
		$this->type_array = array(
			'1' => '班级动态',
			'2' => '校园动态',
		);
		$where = "is_show=1 and type='classNew'";
		if ($this->pid = I('pid')) {
			$where .= " and pid='$this->pid'";
		}
		if ($this->kw = I('kw')) {
			$where .= " and (title like '%$this->kw%')";
		}
		if ($this->pid2 = I('pid2')) {
			$where .= " and pid2='$this->pid2'";
		}
		$model = BoxModel("sns_topic");
		$data = $model->get($where, 10);
		//		dump($data);
		$this->show_page($data['pager']);
		$this->data = $data['list'];
		$this->display();
	}

	/*****删除**/
	public function subject_new_del() {
		$ids = I('ids');
		BoxModel("SnsTopic")->del($ids);
		BoxModel("SnsTopic")->getlastsql();
		$this->jump("删除成功");
	}

	/*****添加班级动态**/
	public function subject_new_add() {
		$this->topic = BoxModel("SnsTopic");
		$this->type_array = array(
			'1' => '班级动态',
			'2' => '校园动态',
		);
		$this->memuNav = "subject_new";
		$this->classrooms_list = BoxModel("edu_subject")->get("is_show=1 and parent_id=0", "", "subject_class");
		$id = I('id');
		if ($id) {
			$this->data = $this->topic->load($id);
			$group_id = $this->pid = $this->data['pid'];
		}
		if (IS_POST) {
			$data = $this->topic->create();
			$data['content'] = stripslashes(htmlspecialchars_decode($_POST['content'])); //防止标签转义
			$data['user_id'] = I('user_id', "0", "intval");
			$data['type'] = 'classNew';
			$data['from'] = "webadmin";
			$topic_id = $this->topic->create_topic($data);
			if ($topic_id) {
				$this->jump("保存成功", U('Subject/subject_new_add', array('id' => $topic_id)));
			}
		}
		$this->display();
	}

	/******添加课程管理****/
	public function add_subject() {
		$this->memuNav = "index";
		$id = I('id');
		$questype = BoxModel('EduQuestions')->questype();
		if ($id) {
			$this->data = $this->subject->load($id);
			$this->data_childs = $this->subject->where(array('parent_id' => $id))->order("subjectid")->select();
			//dump($this->data);
			foreach ($this->data['subjectsetting'] as $one) {
				$subjectsetting[] = $one[questid];
			}

			foreach ($questype as $k => $one) {
				if (in_array($one['questid'], $subjectsetting)) {
					$questype[$k]['choose'] = 1;
				}

			}
		}
		$this->questype = $questype;
		$this->ForExamSearch = json_encode(BoxModel("edu_subject")->ForExamSearch());

		/*****线下课程******/
		if (IS_POST) {
			$childs = I('childs');
			$arr = $this->subject->create();
			$arr['subjectsetting'] = json_encode(I('subjectsetting'));
			$arr['content'] = stripslashes(htmlspecialchars_decode($_POST['content']));
			$arr['rntro'] = stripslashes(htmlspecialchars_decode($_POST['rntro']));
			$arr['FAQ'] = stripslashes(htmlspecialchars_decode($_POST['FAQ']));
			$info = $this->_upload();
			//dump($info->getError());exit();
			if (is_array($info) && $info['picname']) {
				$arr['picname'] = $info['picname']['savepath'] . $info['picname']['savename'];
			}
			if ($id) {
				$this->subject->where(array('subjectid' => $id))->save($arr);
				$url = U('Subject/add_subject', array('id' => $id));
			} else {
				$arr['add_time'] = date("Y-m-d H:i:s");
				$id = $this->subject->add($arr);
				$url = U('Subject/index');
			}
			$model = BoxModel("edu_subject");
			$model->where(array('parent_id' => $id))->delete();
			if ($id && is_array($childs)) {
				$old_childs = $this->data_childs;
				//dump($old_childs);
				//dump($childs);
				//exit();
				foreach ($childs as $k => $one1) {
					$row1 = array(
						'subject' => $one1,
						'parent_id' => $id,
					);
					if ($old_childs[$k]['subjectid']) {
						$row1['subjectid'] = $old_childs[$k]['subjectid'];
						$row1['order_by'] = $old_childs[$k]['order_by'];

					}
					$model->add($row1);
				}
			}
			$this->jump("保存成功", $url);

		}
		$this->display();
	}

	function check_subject() {
		error_reporting(0);
		$name = I('name');
		$value = I($name);
		$value = str_replace(array("O", "P", "R", "C"), array("1", "1", "mt_rand", "1"), $value);
		$str = '$num=' . $value . ';';
		C('SHOW_ERROR_MSG', false);
		C('SHOW_ERROR_MSG_LOG', json_encode(array('valid' => false)));
		eval($str);
		if (is_numeric($num)) {
			$isAvailable = true;
		} else {
			$isAvailable = false;
		}
		echo json_encode(array(
			'valid' => $isAvailable,
		));
	}

	/******开启或关闭课程管理****/
	public function status_subject() {
		$this->memuNav = "index";
		$id = I('id');
		if ($id) {
			$data = $this->subject->load($id);
			$is_show = $data['status'] == 1 ? 2 : 1;
			$this->subject->where(array('subjectid' => $id))->save(array('status' => $is_show));
		}
		$this->jump("操作成功");
		$this->display();
	}

	/******删除课程管理****/
	public function del_subject() {
		$this->memuNav = "index";
		$id = I('id');
		if ($id) {
			$data = $this->subject->load($id);
			$is_show = $data['is_show'] == 1 ? 2 : 1;
			$this->subject->where(array('subjectid' => $id))->save(array('is_show' => $is_show));
			$this->subject->where(array('parent_id' => $id))->save(array('is_show' => $is_show));
		}
		$this->jump("操作成功");
		$this->display();
	}

	/*********章节管理**/
	public function section() {
		$this->memuNav = "index";
		$where = "J.is_show=1";
		if ($this->subjectid = I('subjectid')) {
			$where .= " and S.sectionsubjectid='$this->subjectid'";
			$this->subject_data = $this->subject->load($this->subjectid);
		}
		if ($this->kw = I('kw')) {
			$where .= " and (J.subject like '%$this->kw%' or S.section like '%$this->kw%')";
		}
		$data = $this->subject->get_section($where, 100);
		$this->data = $data['list'];
		//$this->page = $data['pager']->show;
		$this->show_page($data['pager']);
		$this->display();
	}

	/*********添加章节管理**/
	public function add_section() {
		$this->memuNav = "index";
		$this->subjectid = I('subjectid');
		$sectionid = I('id');
		$this->data = $this->subject->get_section_one($sectionid);
		if ($this->data) {
			$this->subjectid = $this->data['sectionsubjectid'];
		}
		$this->subject_data = $this->subject->load($this->subjectid);
		if (!$this->subjectid) {
			$this->jump("缺少课程ID，请选择课程", U('Subject/index'));
		}
		if (IS_POST) {
			$arr = BoxModel("edu_sections")->create();
			$arr['sectionsubjectid'] = $this->subjectid;
			if ($sectionid) {
				BoxModel("edu_sections")->where(array('sectionid' => $sectionid))->save($arr);
				$this->jump("保存成功", U('Subject/section', array('sectionid' => $sectionid)));
			} else {
				$arr['add_time'] = date("Y-m-d H:i:s");
				$r = BoxModel("edu_sections")->add($arr);
				// dump( BoxModel("edu_sections"));exit();
				$this->jump("保存成功", U('Subject/section', array('subjectid' => $this->subjectid)));
			}

		}
		$this->display();
	}

	/******开启或关闭章节****/
	public function status_section() {
		$id = I('id');
		if ($id) {
			$data = $this->subject->get_section_one($id);
			$is_show = $data['status'] == 1 ? 2 : 1;
			BoxModel("edu_sections")->where(array('sectionid' => $id))->save(array('status' => $is_show));
		}
		$this->jump("操作成功");
		$this->display();
	}

	/******删除章节****/
	public function del_section() {
		$id = I('id');
		if ($id) {
			//  $data = $this->subject->get_section_one($id);
			// $is_show = $data['is_show'] == 1 ? 2 : 1;
			//BoxModel("edu_sections")->where(array('sectionid' => $id))->save(array('is_show' => $is_show));
			BoxModel("edu_sections")->where(array('sectionid' => $id))->delete();
			BoxModel("edu_knows")->where(array('knowssectionid' => $id))->delete();
		}
		$this->jump("操作成功");
		$this->display();
	}

	/******知识点****/
	public function knows() {
		$this->memuNav = "index";
		$sectionid = I('sectionid');
		$this->section_data = $this->subject->get_section_one($sectionid);
		$this->data = $this->subject->get_knows($sectionid);
		// dump($this->data);

		$this->display();
	}

	/*****添加知识点*****/
	public function add_knows() {
		$this->memuNav = "index";
		$sectionid = I('sectionid');
		$knowsid = I('knowsid');
		$this->data = BoxModel("edu_knows")->load($knowsid);
		if ($this->data) {
			$sectionid = $this->data['knowssectionid'];
		}
		

		$this->section_data = $this->subject->get_section_one($sectionid);
		//dump( $this->section_data);exit();
		if (IS_POST) {
			$row = BoxModel("edu_knows")->create();
//	$row['video_info']=stripslashes(htmlspecialchars_decode($_POST['video_info'])); //防止标签转义
			$row['pt_note'] = stripslashes(htmlspecialchars_decode($_POST['pt_note'])); //防止标签转义
			$row['questions_content'] = stripslashes(htmlspecialchars_decode($_POST['questions_content'])); //防止标签转义
			$questions = I('questions');
			$row['questions_analysis']=array();
			foreach ($questions as $key => $value) {
				 foreach ($value['step'] as $key1 => $value1) {
				 	 $value['step'][$key1]=stripslashes(htmlspecialchars_decode($value1));
				 }
				 $row['questions_analysis'][]=$value;
			}
			$row['questions_analysis']=json_encode($row['questions_analysis']);
           //上传附件
			$info = $this->_upload(array('saveNameType'=>1));
	        if (is_array($info)) {
	        	$attachment=$this->data['attachment_array'];
	        	if($info['attachment']){
	        		$attachment['attachment']=array(
	        			'name'=>$info['attachment']['name'],
	        			'url'=>ImgDomain . "/" . $info['attachment']['savepath'] . $info['attachment']['savename'],
	        		);
	        	}
	        	if($info['answer']){
	        		$attachment['answer']=array(
	        			'name'=>$info['answer']['name'],
	        			'url'=>ImgDomain . "/" . $info['answer']['savepath'] . $info['answer']['savename'],
	        		);
	        	}
	        	$row['attachment']=json_encode($attachment);
	        }
	        $row['knowssectionid']=I('sectionid',"0","intval");
			$row['subjectid'] = $this->section_data['subjectid'];
			/***题目处理*/

			//dump($row);exit();
			if ($knowsid) {
				BoxModel("edu_knows")->where(array('knowsid' => $knowsid))->save($row);

				$this->jump("保存成功", U('Subject/add_knows', array('knowsid' => $knowsid)));
			} else {
				$row['add_time'] = date("Y-m-d H:i:s");
				$id=BoxModel("edu_knows")->add($row);
				//dump($id);
				//	dump(BoxModel("edu_knows"));exit();
				$this->jump("保存成功", U('Subject/knows', array('sectionid' => $sectionid)));
			}

		}
		$this->display();
	}

	/*****删除知识点*****/
	public function del_knows() {
		$knowsid = I('knowsid');
		BoxModel("edu_knows")->where("knowsid='$knowsid'")->delete();
		$this->jump("删除成功");
	}

	/******视频管理****/
	public function video() {
		$where = "is_show=1";
		if ($this->kw = I('kw')) {
			$where .= " and title like '%$this->kw%'";
		}
		if ($this->subjectid = I('subjectid')) {
			$where .= " and subjectid='$this->subjectid'";
			$this->sections_list = $this->subject->get_section("S.sectionsubjectid='$this->subjectid'");
		}
		if ($this->sectionid = I('sectionid')) {
			$where .= " and sectionid='$this->sectionid'";
		}

		$this->subject_list = $this->subject->get();
		$data = BoxModel("EduVideos")->get($where, 10);
		$this->data = $data['list'];
		$this->page = $data['pager']->show;
		$this->display();
	}

	/*****添加视频管理*****/
	public function add_video() {
		$this->memuNav = "video";
		$this->subject_list = $this->subject->get();
		$sectionsubjectid = $this->subject_list[0]['subjectid'];
		if ($video_id = I('video_id')) {
			$this->data = BoxModel("EduVideos")->load($video_id);
			$sectionsubjectid = $this->data['subjectid'];
		}
		$sections = $this->subject->get_section("S.sectionsubjectid='$sectionsubjectid'");
		$this->sections_list = $sections['list'];
		/********保存数据*****/
		if (IS_POST) {
			$arr = BoxModel("edu_videos")->create();
			if ($video_id = I('video_id')) {
				BoxModel("edu_videos")->where(array('video_id' => $video_id))->save($arr);
				$this->jump("保存成功", U('add_video', array('video_id' => $video_id)));
			} else {
				$arr['add_time'] = date("Y-m-d H:i:s");
				BoxModel("edu_videos")->add($arr);
				$this->jump("保存成功", U('video'));
			}

		}
		$this->display();
	}

	/*****http://console.aodianyun.com/ 奥点云****/
	public function upload_video() {
		$this->display();
	}

	/*****http://console.aodianyun.com/ 奥点云****/
	public function select_video() {
		$this->stime = I('stime');
		$this->etime = I('etime');
		$this->title = I('title');
		if ($etime) {
			$stime = strtotime($this->stime);
			$etime = strtotime($this->etime);
			$uptime = "[$stime, $etime]";
		}
		$post = array(
			'num' => "30",
			'page' => "1",
			'uptime' => $uptime,
			'title' => $title,
		);
		$videoClass = new \Common\Org\Video\Video();
		$data = $videoClass->VodList($post);
		foreach ($data as $k => $one) {
			$data[$k]['duration'] = intval($one['duration']);
			$data[$k]['uptime'] = date("Y-m-d H:i:s", $one['uptime']);
			$data[$k]['video_info'] = json_encode($one);
		}
		$this->data = $data;
		$this->display();
	}

	/*****ajax,请求 获得章节****/
	public function get_ajax_section() {
		$subjectid = I('get.subjectid');
		$type = I('get.type');
		$this->sections_list = $this->subject->get_section_by_subjectid($subjectid);
		$this->display("get_ajax_section{$type}");
	}

	/*****ajax,请求 获得知识点****/
	public function get_ajax_knows() {
		$sectionid = I('get.sectionid');
		$type = I('get.type', "_sel");
		$this->knows_list = $this->subject->get_knows($sectionid);
		$this->display("get_ajax_knows{$type}");
	}

	/******开通课程***/
	public function order() {

		$where = "1";
		$mintime = I('get.mintime');
		$maxtime = I('get.maxtime');
		if ($this->kw = trim(I('kw'))) {
			$where .= " and M.user_id = '%$this->kw%' or (order_sn like '%$this->kw%' or school_num like '%$this->kw%'    or M.email like '%$this->kw%'  or M.mobile like '%$this->kw%')";
		}
		if (!empty($mintime) && !empty($maxtime)) {
			$where .= ' and "' . ($mintime) . '" <= S.addtime && "' . ($maxtime) . ' 23:55" >=  S.addtime';
		}
		if ($this->status = I('status')) {
			$where .= " and S.status='$this->status'";
		}
		$this->type_array = array(1 => '正式开通', 2 => '一元试听');
		$this->status_array = array(1 => '未支付', 2 => '支付成功', 3 => '取消', 4 => '已评论', 5 => '退款');
		$model = BoxModel('edu_subject_order');
		$count = $model->alias("S")->join("edu_students as M on M.user_id=S.user_id")->where($where)->count();
		$pager = $this->setPager($count, 10);
		$data = $model->alias("S")->join("edu_students as M on M.user_id=S.user_id")->where($where)->order('S.addtime desc')->limit($this->limit)->select();
		// dump($model);
		foreach ($data as $k => $one) {
			$row1 = $model->load($one['order_sn']);
			$data[$k] = array_merge($one, $row1);
		}

		$this->data = $data;
		$this->display();
	}

	public function arithmetic() {
		//$order_sn="G9148361356843d";
		//BoxModel("edu_user")->where(array('user_id'=>'100325'))->save(array('is_agent'=>1));
		//BoxModel("system_member")->where(array('user_id'=>'100262'))->save(array('money'=>0,'xuebazi'=>0));
		$order_sn = I('order_sn', "G9148361356843d");
		$debug = I('debug', 1);
		if ($debug == 2) {
			$debug = 0;
		}
		Logic("BoxEdu", "User")->arithmetic($order_sn, $debug);

	}

	public function order_show() {
		$this->memuNav = "order";
		$order_sn = I('order_sn');
		$this->type_array = array(1 => '正式开通', 2 => '一元试听');
		$this->status_array = array(1 => '未支付', 2 => '支付成功', 3 => '取消', 4 => '已评论');
		$this->data = BoxModel('edu_subject_order')->load($order_sn);
		$this->comment = BoxModel('sns_comment_subject_order')->ByField("pid", $order_sn);
		$this->display();
	}

	/******学员心声***/
	public function order_comment() {
		$where = "S.type='orderComment' and S.is_show=1 and S.pid>0";
		$mintime = I('get.mintime');
		$maxtime = I('get.maxtime');
		if ($this->kw = I('kw')) {
			$where .= " and (S.user_id = '%$this->kw%' or S.content like '%$this->kw%' or user_name like '%$this->kw%' or M.nickname like '%$this->kw%' or M.phone like '%$this->kw%' or M.email like '%$this->kw%')";
		}

		if (!empty($mintime) && !empty($maxtime)) {
			$where .= ' and "' . strtotime($mintime) . '" <= S.dateline && "' . strtotime($maxtime . " 23:55") . '" >=  S.dateline';
		}
		if ($this->status = I('status')) {
			$where .= " and status='$this->status'";
		}
		$this->status_array = array(1 => '待处理', 2 => '已处理');
		$model = BoxModel('sns_topic');
		$count = $model->alias("S")->join("system_member as M on M.user_id=S.user_id")->where($where)->count();
		$pager = $this->setPager($count, 10);
		$data = $model->alias("S")->join("system_member as M on M.user_id=S.user_id")->where($where)->field("S.*,M.nickname")->order('S.id desc')->limit($this->limit)->select();
		//$user=BoxModel("system_member");
		//dump($model);
		$subject = BoxModel("edu_subject");
		foreach ($data as $k => $one) {
			//	$userData=$user->where(array('user_id'=>$one['user_id']))->find();
			$subjectData = $subject->where(array('subjectid' => $one['pid']))->find();
			//	$data[$k]['nickname']=$userData['nickname'];
			$data[$k]['subject'] = $subjectData['subject'];
		}
		//dump($model);
		$this->data = $data;
		$this->display();
	}

	/******删除***/
	public function del_order_comment() {
		$id = I('id');
		$bool = BoxModel("SnsTopic")->where(array('id' => $id))->save(array('is_show' => 2));
		$this->jump("删除成功");
	}

	/******考试查询设置***/
	public function examSetting() {

		$ExamQuery = new \Common\Org\ExamQuery();
		$type = I('type');
		$this->array_computer = $ExamQuery->computerHtml($type);
		$this->sf = json_encode($this->array_computer['sf']);
		if ($type == "computer") {
//计算机查询
			$postData = array(
				'state' => I('state'),
				'opt' => I('opt'),
				'ksnf' => I('ksnf'), //考试时间
				'sf' => I('sf'), //省份
				'bkjb' => I('bkjb'), //报考级别
				'zkzh' => I('zkzh'), //准考证号
				'name' => I('name'), //姓名
				'sfzh' => I('sfzh'), //证件号码
				'rand' => I('rand'), //验证码
				'ksxm' => I('ksxm'), //
			);
			//dump($postData);
			$data = $ExamQuery->computerSearch($postData);
			echo json_encode($data);
			exit();
		} elseif ($type == 'accountancy') {
//会计查询
			//  $co=mycurl('http://kjks.bjcz.gov.cn/cjcx/page/cjcxlogin.jsp',"",'ExamQuery_array_accountancy.tmp',1);
			$postData = I();
			$data = $ExamQuery->accountancySearch($postData);
			echo json_encode($data);
			exit();

		}
		$this->computerCodeImage = $ExamQuery->computerHtmlImage();
		$this->display();
	}

	//系统配置
	function setting() {
		$this->display();
	}

}